package com.candy.blog.service.imp;

import com.candy.blog.dao.UserRepository;
import com.candy.blog.pojo.User;
import com.candy.blog.service.UserService;
import com.candy.blog.util.MD5Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @version 1.0
 * @author: 南风
 * @description 实现类
 * @date: 2021/12/26 20:50
 */
@Service
public class UserServiceImp implements UserService {
    @Autowired
    private UserRepository userRepository;

    @Override
    public User checkUser(String username, String password) {
        User user = userRepository.findByUsernameAndPassword(username, MD5Utils.code(password));
        return user;
    }
}
